Higher order grammar